// @Date         2021-11-29
// @Author       Aaron Zhang
// @Description
// @FileName      swagger.go

package template

import "zin/framework/util"

var swaggerTemplate = `
// Package http API.
// @title {{.name}}
// @version 1.1
// @description zin
// @termsOfService https://github.com/swaggo/swag

// @contact.name {{.author}}
// @contact.email {{.author}}

// @license.name Apache 2.0
// @license.url http://www.apache.org/licenses/LICENSE-2.0.html

// @BasePath /
// @query.collection.format multi

// @securityDefinitions.basic BasicAuth

// @securityDefinitions.apikey ApiKeyAuth
// @in header
// @name Authorization

// @x-extension-openapi {"example": "value on a json format"}

package http

import (
    _ "zin/app/http/swagger"
)
`

func CreateSwaggerContent()error{
	data := map[string]interface{}{
		"name":"zin",
		"author":"Aaron zhang",
	}
	return putContentToFileByTemplate("","swagger",swaggerTemplate,util.GetAppProvider().HttpFolder(),data)
}